<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
 <input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<div class="t_bar"><span class="color_red">*</span>实验动物垫料来源和质量保障</div>
<!-- isShow12可用 -->
<table  id="check7" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
<tr>
<td style="width:15%">实验动物垫料来源:</td>
<td style="width:85%">
  <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="do " id="padding_resource_01" style="vertical-align: middle;" name="padding_resource" label="购买" value="01" onchange="isShow12()"/><span style="vertical-align: middle;">购买</span></label> 
	<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="do " id="padding_resource_02" style="vertical-align: middle;" name="padding_resource" label="非购买" value="02" onchange="isShow12(this)"/><span style="vertical-align: middle;" onchange="isShow12()">非购买</span></label>
	<input type="hidden" name="proposal/padding_resource_value" id="padding_resource_value" class="required" value="<x:out select="$xmlData/data/proposal/padding_resource_value" />" label="实验动物垫料来源 " /> 
	<input type="hidden" name="proposal/padding_resource_name" id="padding_resource_name" value="<x:out select="$xmlData/data/proposal/padding_resource_name" />" label="实验动物垫料来源 " /></td>
</td>
</tr>
</table>


<script type = "text/javascript">
function isShow12(){
	
	if ($("#padding_resource_value").val() == "01"){
		//alert($(obj).val());
		
			$("#div3").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
				$(this).addClass("required");
			}
		});
		
		$("#div4").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
			$(this).removeClass("required");
			}
		});
		
		$("#div3").css("display","");
		$("#div4").hide();
		
	}else{
		
		$("#div4").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
				$(this).addClass("required");
			}
		});
		
		$("#div3").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
			$(this).removeClass("required");
			}
		});
		
		$("#div4").css("display","");
		$("#div3").hide();	
		

	}
}

$(document).ready(function(){
isShow12();
});

</script>


<!-- 购买的填写下表，提供产品质量合格证明 -->
<div id = "div3" style="display: none">
<table  id="tblMileStones12" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
   <thead >
					<tr style="border:1px solid #B7D1E6">
					  <th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="20%">垫料类型</th>
						<th class="TblHead" align="center"  width="20%">购买时间</th> 
						<th class="TblHead" align="center"  width="50%">购买单位提供的质量证明</th> 
					</tr>
		</thead>
		
		
		
    <tbody id="tab">
		      <tr style="display:none">

            <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones12" >
						</td>

						<td align="center">
							<span name="milestones12|milestone[0]@seq_no" >[index]</span> 
						</td>
						
		        <td align="center">
						    <cpt:select id="padding_type[index]" name="padding_type"  key="padding_type" onChange="initControlValue(this.id);isShow13(this)"  style="width:80%" ></cpt:select>
				        <input type="hidden" name="milestones12|milestone[0]|padding_type_value" value="" class="required"  lable="垫料类型"/>
				        <input type="hidden" name="milestones12|milestone[0]|padding_type_name" value="" />
		
			          <span style="display:none"><br/>其他垫料类型:<input type="text"  id="content3[0]" name="milestones12|milestone[0]|content3" label="其他垫料类型"  maxlength="5"
						                 class="input_text required"  value=""  style="width:40%"/>
						    </span>
			      </td>
		
		
		        <td align="center">
							<input  id="milestone_date_[0]" name="milestones12|milestone[0]|date" value="" class=" required input_text date" style="width:70px" label="购买时间" />
						</td>
	
	          <td>
	          </td>
		</tr>
		

	   	    <c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/milestones12/milestone" var="milestone">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr>
					
					  <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones12" >
						</td>
					
					
						<td align="center">
							<span   name="milestones12/milestone[${flag}${index}]@seq_no"><x:out select="$milestone/@seq_no"/></span> 
						</td>
						
						<td align="center">
			        <c:set var="padding_type"><x:out select="$milestone/padding_type_value" /></c:set>
			        <cpt:select id="padding_type${index}"   name="padding_type"   key="padding_type" style="width: 80%;" value="${padding_type}" onChange="initControlValue(this.id);isShow13(this)"></cpt:select>
		        	<input type="hidden" name="milestones12/milestone[${flag}${index}]/padding_type_value"  class="required" value="<x:out select="$milestone/padding_type_value" />" label="垫料类型"/>
			        <input type="hidden" name="milestones12/milestone[${flag}${index}]/padding_type_name" value="<x:out select="$milestone/padding_type_name" />"  label="垫料类型"/>
		        
		
						    <span style="display:none"><br/>其他垫料类型:<input type="text"  id="content3[${flag}${index}]" label="其他垫料类型"  maxlength="5"  name="milestones12/milestone[${flag}${index}]/content3"
						           value="<x:out select="$milestone/content3"/>"   style="width:40%"   class="required input_text"/>
						    </span>
		        </td>
						
						<td align="center">
							<c:set var="date" scope="page"><x:out select="$milestone/date"/></c:set>
							<input  id="milestone_date_[${flag}${index}]" value="${date}" label="购买时间" name="milestones12/milestone[${flag}${index}]/date" class="required date input_text"  style="width:70px"/> 
						</td>
					
						<td align="center">
		        </td>
		        
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblMileStones12");
					</script>
				</tbody>
</table>
<br/>

<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones12',8,'实验动物垫料来源和质量保障最多只能填写8条')){addNewRow('tblMileStones12');showDateTag('tblMileStones12');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones12','selMileStones12')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones12','selMileStones12')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones12','实验动物垫料来源和质量保障')">
					</td></tr>
</table>
	<p>注：
1、垫料的材质必须满足国家标准GB14925的8.2.1要求。各单位可根据自己的情况增加实验动物垫料质量控制要求。</p>
</div>


<script type="text/javascript">
    function isShow13(obj){
    var text1 = $(obj).parents().find("td:eq(2)").find("[name$='_value']").val();
    //alert($(obj).parents().find("td:eq(5)").html());
    if (text1 == '03'){
    	$(obj).parents().find("td:eq(2)").find("span").css("display","");
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").addClass("required");
          }	
    else{
    	$(obj).parents().find("td:eq(2)").find("span").hide();
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").val("");
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").removeClass("required");
          }	
    }
    

    
    $(document).ready(function(){
  	  $("#tblMileStones12").find("input[name$='/content3']").each(function(){
  		  isShow13(this);
  	  });
    });
</script>






<!-- 非购买的填写下表 -->
<div id="div4" style="display:none">
<table  id="tblMileStones13" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
   <thead >
					<tr style="border:1px solid #B7D1E6">
					  <th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="30%">垫料类型</th>
						<th class="TblHead" align="center"  width="30%">材质检测项目</th> 
						<th class="TblHead" align="center"  width="30%">购买时间</th> 
				
					</tr>
		</thead>
		
		
		
    <tbody id="tab">
		      <tr style="display:none">

            <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones13" >
						</td>

						<td align="center">
							<span name="milestones13|milestone[0]@seq_no" >[index]</span> 
						</td>
						
		        <td align="center">
						    <cpt:select id="padding_type_1_[index]" name="padding_type"  key="padding_type" onChange="initControlValue(this.id);isShow14(this)"  style="width:80%" ></cpt:select>
				        <input type="hidden" name="milestones13|milestone[0]|padding_type_value" value="" class="required"  lable="垫料类型"/>
				        <input type="hidden" name="milestones13|milestone[0]|padding_type_name" value="" />
		
			          <span style="display:none"><br/>其他垫料类型:<input type="text"  id="content3[0]" name="milestones13|milestone[0]|content3" label="其他垫料类型"  maxlength="5"
						                 class="input_text required"  value=""  style="width:40%"/>
						    </span>
			      </td>
		
		        <td align="center">
						  <input type="text"  id="content1[0]" name="milestones13|milestone[0]|content1" label="材质检测项目"  maxlength="10"
						         class="required input_text"  value=""  style="width:80%"/>
						</td>
		
		        <td align="center">
							<input  id="milestone_date_[0]" name="milestones13|milestone[0]|date" value="" class=" required input_text date" style="width:100px" label="材质检测时间" />
						</td>
	
		</tr>
		

	   	    <c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/milestones13/milestone" var="milestone">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr>
					
					  <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones13" >
						</td>
					
					
						<td align="center">
							<span   name="milestones13/milestone[${flag}${index}]@seq_no"><x:out select="$milestone/@seq_no"/></span> 
						</td>
						
						<td align="center">
			        <c:set var="padding_type"><x:out select="$milestone/padding_type_value" /></c:set>
			        <cpt:select id="padding_type_1_${index}"   name="padding_type"   key="padding_type" style="width: 80%;" value="${padding_type}" onChange="initControlValue(this.id);isShow14(this)"></cpt:select>
		        	<input type="hidden" name="milestones13/milestone[${flag}${index}]/padding_type_value"  class="required" value="<x:out select="$milestone/padding_type_value" />" label="垫料类型"/>
			        <input type="hidden" name="milestones13/milestone[${flag}${index}]/padding_type_name" value="<x:out select="$milestone/padding_type_name" />"  label="垫料类型"/>
		        
		
						    <span style="display:none"><br/>其他垫料类型:<input type="text"  id="content3[${flag}${index}]" label="其他垫料类型"  maxlength="5"  name="milestones13/milestone[${flag}${index}]/content3"
						           value="<x:out select="$milestone/content3"/>"   style="width:40%"   class="required input_text"/>
						    </span>
		        </td>
		        
		        <td align="center">
						    <input type="text"  id="content1[${flag}${index}]" label="材质检测项目"  maxlength="10"  name="milestones13/milestone[${flag}${index}]/content1"
						           value="<x:out select="$milestone/content1"/>"   style="width:80%"   class="required input_text"/>
						</td>
		        
						<td align="center">
							<c:set var="date" scope="page"><x:out select="$milestone/date"/></c:set>
							<input  id="milestone_date_[${flag}${index}]" value="${date}" label="材质检测时间" name="milestones13/milestone[${flag}${index}]/date" class="required date input_text"  style="width:100px"/> 
						</td>

					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblMileStones13");
					</script>
				</tbody>
</table>
<br/>

<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones13',8,'实验动物垫料来源和质量保障最多只能填写8条')){addNewRow('tblMileStones13');showDateTag('tblMileStones13');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones13','selMileStones13')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones13','selMileStones13')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones13','实验动物垫料来源和质量保障')">
					</td></tr>

</table>
	<p>注：
1、垫料的材质必须满足国家标准GB14925的8.2.1要求。各单位可根据自己的情况增加实验动物垫料质量控制要求。</p>
<br/>
</div>


<script type="text/javascript">
    function isShow14(obj){
    var text1 = $(obj).parents().find("td:eq(2)").find("[name$='_value']").val();
    //alert($(obj).parents().find("td:eq(5)").html());
    if (text1 == '03'){
    	$(obj).parents().find("td:eq(2)").find("span").css("display","");
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").addClass("required");
          }	
    else{
    	$(obj).parents().find("td:eq(2)").find("span").hide();
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").val("");
    	$(obj).parents().find("td:eq(2)").find("span").find("[id^='content']").removeClass("required");
          }	
    }
    

    
    $(document).ready(function(){
  	 $("#tblMileStones13").find("input[name$='/content3']").each(function(){
  		  isShow13(this);
  	  });
    });
</script>

